<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="nav" content="0" />
<meta name="acc" content="4-0" />
<title>工作日志</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中     -->
<script>

$(document).ready(function() {
	$("#workDate").addClass("Wate").bind("click", function(){
	 WdatePicker({skin:'whyGreen',minDate:'1900-10-01' , dateFmt:'yyyy-MM-dd'});
	 });
	
	 //为第一个文本框获得焦点
	  $("#task").focus();
	 //验证
	 $("#inputForm").validate({
		 isTip:false,
		 rules:{
			 task:{
				 required:true,
				 maxlength:15
			 },
			 workDate:{
				 required:true
			 },
			 schedule:{
				 number: true
			 },
			 spendTime:{
				 number: true
			 }
		 },
		 messages:{
			 workDate:{
				 required:"请填写工作日期!"
			 },
			 spendTime:{
				 number:"只能输入数字(包括小数)!"
			 },
			 schedule:{
				 number:"只能输入数字(包括小数)!"
			 }
		 }
		 }
	 );
});	
</script>

</head>
<body>
<form action="worklog!save.action" method="post" id="inputForm"
	class='yform' enctype="multipart/form-data">
<div id="caption" ><h6>工作日志</h6></div>
<table class="noborder">
	<tr class="type-title">
	</tr>
	<tr class="type-text">
		<td>工作任务</td>
		<td><input name="id" type="hidden" value="${id}" /> <input
			id="task" name="task" type="text" value="${task}" /></td>
	</tr>
	<tr class="type-text">
		<td>花费时间</td>
		<td><input type="text" id="spendTime" name="spendTime"  value="${spendTime}" /></td>
		<td>完成进度</td>
		<td><input type="text" id="schedule" name="schedule"  value="${schedule}" /></td>
	</tr>
	<tr class="type-text">
		<td>日志类型</td>
		<td>
		<pt:code category="1007" name="type" default="${type}"></pt:code></td>
		<td>工作日期</td>
		<td>
		<input id="workDate" name="workDate" type="text" value="${workDate}" />
		</td>
	</tr>
	<tr>
		<td>附件</td>
		<td colspan="3"><input type="file" name="attachmention.upfile" /> </td>
	</tr>
		<c:if test="${not empty attachment.id}">
				<tr id="attachment">
				<td>已有附件</td>
				<td colspan="3">
				<a title="下载"
					href="${ctx}/servlet/annex?id=${attachment.id}">${attachment.upfileFileName}</a>
				<span onclick="deleteAttachment('${attachment.id}')" class="delete" title="删除附件"></span>
				</td>
			</tr>
			</c:if>
	<tr>
		<td>工作内容</td>
		<td colspan="3"><textarea id="content" name="content" >${content}</textarea> </td>
	</tr>
	<tr>
		<td>备注</td>
		<td colspan="3"><textarea id="remark" name="remark">${remark}</textarea> </td>
	</tr>
</table>
<div class="type-button"><input   type="submit"
	class="submit" value="提交" />&nbsp; <input   type="button"
	value="返回" class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>
